package com.vchello.resulthandler;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;

@SuppressWarnings("rawtypes")
public class MapToObjectHandler implements ResultHandler {

	private List<Object[]> result = new ArrayList<Object[]>();
	
	@Override
	public void handleResult(ResultContext resultContext) {
		LinkedHashMap map =  (LinkedHashMap) resultContext.getResultObject();
		result.add(new Object[]{map.get("id"),map.get("name")});
	}
	
	public List<Object[]> getObjectArry(){
		return result;
	}

}
